package xianxin;

/**
 * Created by hasee on 2017/9/28.
 */
public class MyArrayList {
    Student[] list = new Student[10];

    public void add(Student student){//尾部插入数据
        for (int i = 0; i < list.length; i++) {//正序遍历数组,直到找到空位
            if(list[i]==null){
                list[i]=student;//插进空位
                return;
            }
        }
    }
    public void printAll(){
        for (int i = 0; i < list.length ; i++) {
            System.out.println(list[i]);
        }
    }
}
